.class Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic this$0:Lcom/snowplowanalytics/snowplow/tracker/Emitter;

.field final synthetic val$payload:Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;


# direct methods
.method constructor <init>(Lcom/snowplowanalytics/snowplow/tracker/Emitter;Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;)V
    .locals 0

    iput-object p1, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Emitter;

    iput-object p2, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->val$payload:Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 3

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Emitter;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Emitter;->eventStore:Lcom/snowplowanalytics/snowplow/tracker/storage/EventStore;
    invoke-static {v0}, Lcom/snowplowanalytics/snowplow/tracker/Emitter;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Emitter;)Lcom/snowplowanalytics/snowplow/tracker/storage/EventStore;

    move-result-object v0

    iget-object v1, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->val$payload:Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;

    invoke-virtual {v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/storage/EventStore;->add(Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;)V

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Emitter;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Emitter;->isRunning:Ljava/util/concurrent/atomic/AtomicBoolean;
    invoke-static {v0}, Lcom/snowplowanalytics/snowplow/tracker/Emitter;->access$200(Lcom/snowplowanalytics/snowplow/tracker/Emitter;)Ljava/util/concurrent/atomic/AtomicBoolean;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Emitter$1;->this$0:Lcom/snowplowanalytics/snowplow/tracker/Emitter;

    # invokes: Lcom/snowplowanalytics/snowplow/tracker/Emitter;->attemptEmit()V
    invoke-static {v0}, Lcom/snowplowanalytics/snowplow/tracker/Emitter;->access$300(Lcom/snowplowanalytics/snowplow/tracker/Emitter;)V

    :cond_0
    return-void
.end method
